<?php 
function dateDiff($dformat, $endDate, $beginDate)
{
	$date_parts1=explode($dformat, $beginDate);
	$date_parts2=explode($dformat, $endDate);
	$start_date=gregoriantojd($date_parts1[1], $date_parts1[2], $date_parts1[0]);
	$end_date=gregoriantojd($date_parts2[1], $date_parts2[2], $date_parts2[0]);
	return round(($end_date - $start_date));
}

function logWrite($logEntry){
$myFile = "../log/log_" . date('d-m-Y') . ".txt";
$fh = fopen($myFile, 'a');
$fh = fopen($myFile, 'a') or die("can't open file");
fwrite($fh, $logEntry . "\n");
fclose($fh);
}
?>
